Inspection System with Auto-Focus

ABSTRACT

Apparatus for optical inspection of a sample includes a detector assembly, which is configured to receive radiation from a focal area on the sample, and a translation mechanism, which is operative to impart motion to at least one of the detector assembly and the sample so that the focal area of the detector assembly translates over the sample along a translation path. A height sensor is positioned in a known location relative to the detector assembly so as to measure a height of the height sensor relative to a point on the sample that is ahead of the focal area by a predetermined distance along the translation path. A controller is adapted to determine an estimated height of the detector assembly, responsively to the height measured by the height sensor along the translation path.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a Continuation of U.S. application Ser. No.10/877,311 which claims the benefit of U.S. Provisional PatentApplication No. 60/523,376, filed Nov. 18, 2003, whose disclosure isincorporated herein by reference.

FIELD OF THE INVENTION

The present invention relates generally to optical inspection, andspecifically to methods and apparatus for automatic focus adjustmentduring scanning of a solid-state surface by an optical inspectionsystem.

BACKGROUND OF THE INVENTION

Maintaining proper focus of objective optics can be critically importantin high-resolution optical inspection systems, such as those used inproduction of semiconductor devices. Most inspection systems useauto-focus mechanisms based on optical sensing methods. Opticalauto-focus sensing has the advantage that the quality of the opticalfocus can be sensed within the focal area of the optics withoutinterfering substantially with the image capture function of the optics.For some applications, however, optical sensing may not providesufficient focal precision, due, for example, to color variations on theinspected surface or to local height variations in the surface that aretoo small for the auto-focus system to track.

Other, non-optical types of non-contact position sensors are also knownin the art. For example, Lion Precision, of Saint Paul, Minnesota,produces a line of capacitive sensors, which may be used inmicro-positioning. These sensors are capable of making position readingswith high bandwidth and tracking precision of 0.1 μm or less. Adisadvantage of these sensors, however, is that they are opticallyopaque, and therefore cannot generally be used to make measurements inthe focal area of an optical system without blocking at least part ofthe field of view of the optics.

The use of capacitive position sensors in automated focus adjustment ofoptical inspection systems has been described in the patent literature.For example, U.S. Patent Application Publication US 2002/0001403 A1,whose disclosure is incorporated herein by reference, describes a methodfor automatically focusing an ultraviolet objective lens, using acapacitance sensor near the objective lens. The capacitive sensor isused to measure a distance between the objective lens and an objectunder inspection, and the objective lens or object is moved based on theresult of the measurement.

As another example, U.S. Patent Application Publication US 2002/0067477A1, whose disclosure is incorporated herein by reference, describes theuse of a capacitance-type sensor disposed near an objective lens todetect the distance between the objective lens and a semiconductor waferunder inspection. The focusing of the optical imaging system is adjustedby driving a moving stage vertically until the distance between theobjective lens and the semiconductor wafer becomes optimal.

SUMMARY OF THE INVENTION

In some embodiments of the present invention, an optical inspectionsystem comprises a detector assembly and a focus adjustment mechanismthat is based on one or more non-optical sensors. Typically, thedetector assembly comprises an optical detector, such as an image sensorarray, and objective optics, which form an image on the detector of anarea of a sample under inspection. (The area of the sample whose imageis captured by the detector assembly at a given point in time isreferred to herein as the “focal area.”) The non-optical sensorstypically comprise height sensors, such as capacitive sensors, which arepositioned in fixed, known locations alongside the detector assembly.Each height sensor measures its own respective height relative to apoint below it on surface of the sample. The focus adjustment mechanismadjusts the focus of the image formed by the objective optics accordingto the heights measured by the one or more height sensors.

Since the height sensors make their height measurements relative topoints outside the focal area of the detector assembly, in embodimentsof the present invention the focus adjustment mechanism takes intoaccount the displacement between the focal area and the heightmeasurement points. For this purpose, in some embodiments, two or moreheight sensors are disposed on opposing sides of the detector assembly.The focus adjustment mechanism combines the height readings of thesensors to estimate the actual height of the detector assembly relativeto the focal area on the sample surface. For this purpose, the focusadjustment mechanism may take an arithmetic average of the heightreadings. Alternatively, other estimation techniques may be used, suchas second- or higher-order curve fitting, in order to estimate andcompensate for the curvature of the sample surface. The focus adjustmentmechanism typically makes special provision for height estimation whenimaging areas near the edges of the sample, at which the height readingof at least one of the height sensors may be invalid.

In some embodiments of the present invention, a translation mechanismmoves either the detector assembly or the sample, or both, so that thefocal area of the detector assembly scans over the sample along atranslation path in a selected scanning pattern. The height sensor orsensors are positioned so that at least one of the height sensorsmeasures its height relative to a point on the sample that is ahead ofthe focal area of the detector assembly on the translation path. Thefocus adjustment mechanism uses the reading of the height sensor to“look ahead” by a predetermined distance along the scan path. In otherwords, the focus of the image at each point along the translation pathis adjusted based on the height measured a short time earlier by theheight sensor when the height sensor was located over the same point onthe translation path.

In some of these embodiments, the scanning pattern comprises a rasterscan, and the translation path comprises multiple parallel scan lines inthe raster. Typically, the translation mechanism scans over successivelines of the raster pattern in opposite (zigzag) directions. Two heightsensors are disposed alongside the detector assembly, one on either sidealong the scan axis, so that one of the sensors gives a height readingat a point ahead of the focal area of the detector assembly in each scandirection.

There is therefore provided, in accordance with an embodiment of thepresent invention, apparatus for optical inspection of a sample,including:

detector assembly, which is configured to receive radiation from a focalarea on the sample;

a translation mechanism, which is operative to impart motion to at leastone of the detector assembly and the sample so that the focal area ofthe detector assembly translates over the sample along a translationpath;

a height sensor, positioned in a known location relative to the detectorassembly so as to measure a height of the height sensor relative to apoint on the sample that is ahead of the focal area by a predetermineddistance along the translation path; and

a controller, which is adapted to determine an estimated height of thedetector assembly, responsively to the height measured by the heightsensor along the translation path.

In some embodiments, the apparatus includes a focus adjustmentmechanism, which is operative to adjust a focus of the detectorassembly, responsively to the estimated height. Typically, the focusadjustment mechanism is adapted to apply the estimated height in orderto adjust the focus after a predetermined time during which thetranslation mechanism has scanned the focal area to the point at whichthe height was measured. Additionally or alternatively, the focusadjustment mechanism is adapted to apply the height measured at thepoint in order to adjust the focus after the focal area has translatedover the sample by the predetermined distance.

In some embodiments, the height sensor includes a first height sensor,which is positioned in a first known location on a first side of thedetector assembly and measures a first height relative to a first pointon the sample, and the apparatus includes a second height sensor, whichis positioned in a second known location on a second side of thedetector assembly, opposite the first side, so as to measure a secondheight relative to a second point on the sample. Typically, thecontroller is operative to determine the estimated height responsivelyto the first and second heights. In one embodiment, the controller isadapted to determine the estimated height responsively to an average ofthe first and second heights.

In some of these embodiments, the translation mechanism is adapted tocause the focal area to scan over the sample along a plurality of scanlines in a raster pattern, such that the focal area scans along at leastsome of the scan lines in a first direction, in which the first point isahead of the focal area, and the focal area scans along other ones ofthe scan lines of the raster pattern in a second direction, in which thesecond point is ahead of the focal area. Typically, the controller isadapted to determine the estimated height responsively to the firstheight on the at least some of the scan lines, and responsively to thesecond height on the other ones of the scan lines.

In disclosed embodiments, the translation mechanism is adapted to causethe focal area to scan over the sample along a plurality of scan linesin a raster pattern. Typically, at least one of the scan lines extendsbeyond an edge of the sample, such that at a beginning of the at leastone of the scan lines, the height sensor is positioned to measure theheight of the height sensor in proximity to the edge of the sample whilethe focal area of the detector assembly remains at least partiallybeyond the edge, and wherein the controller is adapted to store theheight measured by the height sensor in proximity to the edge and todetermine the estimated height at the beginning of the at least one ofthe scan lines responsively to the stored height.

Typically, the detector assembly includes at least one detector andoptics, which are configured to form an image of the focal area on theat least one detector. In some embodiments, the height sensor includes anon-optical sensor, typically a capacitive sensor. In a disclosedembodiment, the optics have a collection angle, and the height sensor istilted so as to measure the height in proximity to the focal areawithout blocking the collection angle. In an exemplary embodiment, thesample includes a semiconductor wafer.

There is also provided, in accordance with an embodiment of the presentinvention, apparatus for optical inspection of a sample, including:

a detector assembly, which is configured to receive radiation from afocal area on the sample;

first and second height sensors, positioned in known locations relativeto the detector assembly so as to measure respective first and secondheights of the first and second height sensors relative to respectivefirst and second points on the sample on opposing sides of the focalarea; and

a controller, which is adapted to determine an estimated height of thedetector assembly, responsively to the first and second heights measuredby the first and second height sensors.

In a disclosed embodiment, the controller is adapted to determine theestimated height responsively to an average of the first and secondheights.

In another embodiment, the apparatus includes a translation mechanism,which is operative to impart motion to at least one of the detectorassembly and the sample so that the focal area of the detector assemblytranslates over the sample along a translation path, and the controlleris adapted to determine a curvature of the sample responsively tomultiple readings of the first and second heights measured at multiplepoints along the translation path, and to determine the estimated heightresponsively to the curvature. Typically, the controller is adapted todetermine the curvature by performing a spline fit to the multiplereadings of the first and second heights.

In a further embodiment, the apparatus includes at least third andfourth height sensors, which are positioned relative to the detectorassembly so that the first, second, third and fourth height sensorssurround the focal area.

In some embodiments, the apparatus includes a translation mechanism,which is operative to impart motion to at least one of the detectorassembly and the sample so that the focal area of the detector assemblyscans over the sample along one or more scan lines, wherein the firstand second points are disposed on the scan lines, so that on each of thescan lines, one of the first and second points is ahead of the focalarea, and another of the first and second points is behind the focalarea. Typically, at least one of the scan lines extends beyond an edgeof the sample, to a location at which the first height sensor is unableto provide a valid measurement of the first height, and the controlleris adapted to store the first height measured by the first height sensorin proximity to the edge and to determine the estimated height at thelocation responsively to the stored first height. In one embodiment, thecontroller is adapted to determine an offset value responsively to adifference between the first and second heights measured in proximity tothe edge, and to determine the estimated height at the location at whichthe first height sensor is unable to provide the valid measurement ofthe first height responsively to the second height measured by thesecond height sensor at the location and to the offset value.

There is additionally provided, in accordance with an embodiment of thepresent invention, a method for optical inspection of a sample,including:

receiving radiation at a detector assembly from a focal area on thesample;

translating the focal area over the sample along a translation path;

positioning a height sensor in a known position relative to the detectorassembly so as to measure a height of the height sensor relative to apoint on the sample that is ahead of the focal area by a predetermineddistance along the translation path; and

determining an estimated height of the detector assembly responsively tothe height measured by the height sensor along the at least some of thescan lines of the raster pattern.

There is further provided, in accordance with an embodiment of thepresent invention, a method for optical inspection of a sample,including:

receiving radiation at a detector assembly from a focal area on thesample;

positioning first and second height sensors in known locations relativeto the detector assembly so as to measure respective first and secondheights of the first and second height sensors relative to respectivefirst and second points on the sample on opposing sides of the focalarea; and

determining an estimated height of the detector assembly responsively tothe first and second heights measured by the first and second heightsensors.

The present invention will be more fully understood from the followingdetailed description of the embodiments thereof, taken together with thedrawings in which:

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic, partly pictorial illustration of an opticalinspection system, in accordance with an embodiment of the presentinvention;

FIG. 2A is a schematic side view of objective optics and height sensorsused in an optical inspection system, in accordance with an embodimentof the present invention;

FIG. 2B is a schematic top view of a sample under inspection, showing anarea of an image captured by an optical inspection system and adjacentheight sensing areas, in accordance with an embodiment of the presentinvention;

FIG. 3 is a schematic top view of a sample under inspection, showingregions near the edge of the sample in which a modified height sensingmethod is used, in accordance with an embodiment of the presentinvention; and

FIG. 4 is a schematic top view of a sample under inspection, showing anarea of an image captured by an optical inspection system and adjacentheight sensing areas, in accordance with another embodiment of thepresent invention.

DETAILED DESCRIPTION OF EMBODIMENTS

FIG. 1 is a schematic, pictorial illustration of a system 20 for opticalinspection of a sample, such as a semiconductor wafer 22, in accordancewith an embodiment of the present invention. System 20 comprises anautofocus mechanism 24, whose design and operation are described indetail hereinbelow. Although this subsystem is described here, by way ofexample, in the context of a wafer inspection system, it may similarlybe applied in optical inspection systems of other sorts—including bothbright-field and dark-field inspection systems—for inspection not onlyof semiconductor wafers, but also of samples of other types.

System 20 comprises an illumination module 26, which illuminates an areaon wafer 22 with either pulsed or continuous illumination. Theillumination may be in the visible, infrared or ultraviolet range of thespectrum, or may include radiation in two or more of these rangessimultaneously. A detector assembly 27 captures an image of theilluminated area of the wafer. The area of the wafer surface whose imageis captured by the detector assembly is referred to herein as the focalarea of the detector assembly. Signals generated by detector assembly 27are processed by an image processor 32, typically in order to detectdefects on wafer 22 or to assess other surface features.

Typically, detector assembly 27 comprises objective optics 28 and atleast one detector 30. The detector typically comprises an image sensorarray, and objective optics 28 form a magnified image on the array ofthe focal area of the wafer surface. In one embodiment, detector 30comprises multiple image sensor arrays, and optics 28 are configured toform respective images on the arrays of the radiation scattered from thefocal area into different, respective angular ranges. Detectorassemblies of this sort are described in detail in U.S. patentapplication Ser. No. 06/415,082 filed 30 Sep. 2002, PCT applicationW02004031754, PCT application W02004031753 and PCT applicationW02004031741 which are assigned to the assignee of the present patentapplication and whose disclosures are incorporated herein by reference.Alternatively, system 20 may comprise other types of illuminationmodules and detector assemblies, such as a flying-spot laser scanner anddetector. (Note that in systems using flying-spot-type illumination, thefocal plane is determined by the illumination optics, and hence theautofocus mechanism described below should be configured to control theheight of the wafer relative to the illumination optics, rather thanrelative to the detector assembly.)

The focal area of detector assembly 27 is generally much smaller thanthe total area of wafer 22 that is to be inspected. Therefore, wafer 22is typically mounted on a translation stage 34, which serves as atranslation mechanism to scan the wafer in a raster pattern relative tothe detector assembly. Alternatively, the translation mechanism may beadapted to move the detector assembly, or to move both the detectorassembly and the wafer, or to optically scan the focal area of thedetector assembly over the wafer surface. In the description thatfollows, for convenience and clarity, the plane of wafer 22 is taken tobe the X-Y plane, and the parallel scan lines of the raster scan areassumed to be aligned in the Y-direction. Typically, to maximize thethroughput of system 20, stage 34 scans over successive lines of theraster pattern in opposite (zigzag) directions. Alternatively, thetranslation mechanism in system 20 may comprise a rotation stage, whichscans wafer 22 in a circular or spiral pattern. Further alternatively,the translation mechanism may cause detector assembly 27 to scan overthe wafer in any other suitable pattern known in the art. Scanning andother operations in system 20 are coordinated by a system controller 44.

Autofocus mechanism 24 comprises an elevation stage 36, which raises andlowers wafer 22 (in the Z-direction) under the command of an autofocuscontroller 38. Stage 36 typically comprises a precision motorized stage,which is capable of fixing the vertical position of the wafer to withinabout 1 μm . Such stages are commercially available, for example, fromPhysik Instrumente (Karslruhe, Germany). Alternatively, a piezoelectricstage may be used if finer vertical positioning is required. Furtheralternatively or additionally, the autofocus controller may raise andlower the detector assembly or may change the distance between optics 28and detector 30 (or may change the distance between elements of optics28 in order to adjust the focal plane location).

Capacitive height sensors 40 (labeled C₁ and C₂) are used to determinethe proper focus adjustment for each image along the scan. Each heightsensor generates a voltage that is proportional to its distance from thesurface of wafer 22. Sensors 40 are fixed to the detector assembly toeither side of the focal area. In one embodiment, the lower surfaces ofsensors 40 are located about 0.5 mm from the wafer surface and arecapable of measuring height variations within a range of about ±50 μm,with a tracking accuracy of about ±0.1 μm and high bandwidth (typicallyup to 20 kHz). Height variations of the surface may occur, for example,due to unevenness or bowing of the wafer under inspection. Since theheights of sensors 40 are fixed and calibrated relative to optics 28,any short-term variation in the voltage outputs of sensors 40 isindicative of a corresponding change in the distance between the opticsand the surface of wafer 22. (Sensor drift may cause long-termvariations, which are typically calibrated out of the readings, asdescribed further hereinbelow.) A height sense driver 42 receives andprocesses the voltage readings provided by sensors 40, in order toprovide one or more height inputs to autofocus controller 38.

Although the embodiments described herein use capacitive height sensors,other types of non-contact sensors may be used to similar effect. Forexample, sensors 40 may comprise inductive distance sensors, ornon-optical precision distance sensors of other types, as are known inthe art. Aspects of the present invention may also be adapted for usewith optical focus sensors.

Reference is now made to FIGS. 2A and 2B, which show details ofobjective optics 28 and height sensors 40, in accordance with anembodiment of the present invention. FIG. 2A is a side view of theheight sensors and optics, while FIG. 2B is a top view of the surface ofwafer 22, showing focal area 50 and “footprints” 52 of the heightsensors. These footprints represent the approximate area of the wafersurface that influences the capacitance measured by each of the sensors,and hence determine the height readings. The height sensors C₁ and C₂measure their respective heights, h₁ and h₂, with respect to the wafersurface at the center points of the footprints, which are displaced by adistance D along the Y-axis from the center of the focal area. As notedabove, h₁ and h₂ in system 20 are typically on the order of 0.5 mm, andmay vary over a range of ±50 μm over the surface of wafer 22.

The bodies of height sensors 40 may be tilted, as shown in FIG. 2A, soas to permit footprints 52 to approach focal area 50 in close proximityto the focal area without blocking the collection angle of optics 28. Asa result, footprints 52 are elliptical, rather than round. Due tophysical constraints imposed by the construction and operation of heightsensors 40, the height readings provided by the sensors are actuallyaveraged over the footprint areas. Typically, for capacitive heightsensors of sufficient sensitivity and accuracy, footprints 52 are eachabout 3 mm long by 2 mm wide, and the centers of the footprints aredisplaced by D=8 mm from the center of focal area 50. The footprints areslightly larger than the actual dimensions of the sensors. The averagednature of the height sensor readings is advantageous in that it tends tosmooth over small, local height variations that are not useful toautofocus mechanism 24. On the other hand, if any part of footprint 52of either of sensors 40 is not entirely on the surface of wafer 22, theheight readings provided by that sensor may be invalid. This problem isaddressed further hereinbelow with reference to FIG. 3.

Autofocus controller 38 uses the readings of sensors 40 (as provided byheight sense driver 42) to determine a feedback control parameter h,which is indicative of the height of optics 28 relative to the wafersurface. The autofocus controller then drives stage 36 so as to zero outany variations in h, so that optimal focus is maintained over the entirescan of wafer 22. A number of different operational modes may be used indetermining the parameter h:

-   -   Single sensor control—In this mode of operation, the autofocus        controller simply chooses one of sensors 40 and assumes that the        readings of that sensor are indicative of the present height of        optics 28 relative to wafer 22. This approach has the advantage        of simplicity, but is susceptible to error due to local height        variations over the distance D between sensor footprint 52 and        focal area 50. Therefore, this mode is typically not used in        system 20 except possibly in edge regions in which the height        readings of one or both sensors are invalid.    -   Look-ahead control—The height reading of the height sensor that        is ahead of focal area 50 along the current Y-direction scan        line is predictive of the height of optics 28. In the example        shown in FIGS. 2A and 2B, the height reading hi provided by        sensor C₁ at any point gives the height at which optics 28 will        be positioned relative to wafer 22 after stage 34 has advanced        the focal area in the scan direction by the distance D. In other        words, taking y as the Y-coordinate of the center of focal area        50 along a given scan line, the height of the optics h(y) is        given by:        h(y)=h ₁(y−D)−[Z(y)−Z(y−D)]  (1)    -   Here Z(y) is the height setting of elevation stage 36 when the        focal area is at location y along the Y-axis (which must be        taken into account in interpreting the readings of the height        sensor). The height h(y) given by equation (1) is used by        controller 36 in order to drive stage 36 to the proper height        for optimal focus at point y. When the scan line is scanned in        the opposite direction, sensor C₂ and height reading h₂ are used        instead.    -   Balanced control—The current height readings of the two sensors,        C₁ and C₂, are both used in determining the height of the        optics. For example, the height of the optics may be estimated        as the arithmetic average of the two sensor readings:        h(y)=½[d ₁(y)+h ₂(y)]  (2)    -   This approach has the advantages of compensating for errors in        flatness or tilt of translation stage 34, and of immunity to        inaccuracies in reading the setting Z(y) of elevation stage 36        (as input to equation (1), for example). It requires, however,        that a different control mode be used in edge regions 54 and 56,        as described hereinbelow.

The averaging approach does not take into account local curvature of thewafer surface. For this purpose, a higher-order fit may be used, such asa spline interpolation: $\begin{matrix}{{h(y)} = {{\frac{1}{2}\left\lbrack {{h_{1}\left( {y - D} \right)} + {h_{2}\left( {y + D} \right)}} \right\rbrack} + {\alpha\quad{D\left\lbrack {\frac{\partial{h_{1}\left( {y - D} \right)}}{\partial y} - \frac{\partial{h_{2}\left( {y + D} \right)}}{\partial y}} \right\rbrack}}}} & (3)\end{matrix}$

-   -   Here α is a weighting factor, which may be optimized for best        interpolation results. Although the spline fit may give more        accurate results than a linear average, it is more complicated        to calculate and may be more sensitive to noise due to the        derivative terms in equation (3). Alternatively, other        higher-order approximations may be used, as will be apparent to        those skilled in the art.

It can be seen in equations (1), (2) and (3) above that accuratedetermination of the height parameter h(y), and hence accurateadjustment of the optics, depends on accurate calibration of the sensorheight readings h₁ and h₂. These readings are subject to a certainamount of DC drift. Furthermore, since the voltage generated by sensors40 depends on capacitance measured by the sensors with respect to thewafer surface, there may be variations in the height readings due to thecomposition of the surface layers of the wafer. For example, thereadings of sensors 40 may vary depending on whether the surface layercontains large amounts of metal or oxide. The relatively large footprint52 of the sensors is useful in averaging over local variations insurface composition, but calibration of the sensors relative to thenature of the wafer surface that is under inspection is still useful ineliminating drift and material-dependent effects. The inventors havefound that in the absence of such calibration, reading inaccuracy of upto about a few μm may occur.

In an embodiment of the present invention, the readings of height sensedriver 42 are calibrated against an optimal optical focus of optics 28.The calibration procedure may be performed either on the actual waferthat is to be inspected or on a special reference wafer, which issimilar in surface composition to the wafer that is to be inspected.System controller 44 drives stage 36 up and down, while detector 30captures images of the wafer. This procedure is repeated until thesystem controller finds the Z-location of the wafer that gives the bestoptical focus. Typically, the best focus is considered to be that whichgives the sharpest edges, or equivalently the highest contrast betweenbright and dark areas in the image. The voltage readings of sensors 40are then measured at the Z-location of the optimal optical focus. Thesereadings serve as the zero point for height readings and adjustmentduring subsequent inspection scans. In this manner, drift-relatedchanges in the readings of sensors 40 are canceled out.

FIG. 3 is a schematic top view of wafer 22, illustrating edge regions 54and 56 in which the above-mentioned methods of operation are typicallymodified, in accordance with embodiments of the present invention. Inthis figure, the scan axis (Y-axis) is oriented in the verticaldirection. Within region 54, in proximity to the edge of wafer 22,height sensor C₂ gives an invalid (or at least suspect) reading, whileheight sensor C₁ gives invalid or suspect readings in a region 56. Notethat at the edges of the wafer along the X-axis (at the extreme left andright of the wafer), footprints 52 of both height sensors may extendover the edge of the wafer, so that neither sensor gives a validreading. The difficulties of autofocus control in regions 54 and 56 areaddressed by embodiments of the present invention that are describedhereinbelow.

In order to describe the operation of autofocus mechanism 24 in regions54 and 56, it is useful to distinguish between the following foursituations:

-   (1) Beginning of scan line.-   (2) End of scan line.-   (3) Beginning of wafer scan.-   (4) End of wafer scan.    It is assumed that at the beginning and end of each scan line, focal    area 50 reaches (and typically passes) the edge of wafer 22. Thus,    in the example shown in FIG. 3, if we assume the current scan line    to be in the positive Y-direction (upward in this figure), focal    area 50 and footprint 52 of at least sensor C₁ would have been off    the lower edge of the wafer at the beginning of the scan line. When    the scan reaches the end of the scan line, at least the footprint of    sensor C₂ and focal area 50 will extend off the upper edge of the    wafer. Assuming that the next scan line proceeds in the negative    Y-direction, these relations will be reversed. At the beginning and    end of the wafer scan (at the left and right sides of the wafer in    FIG. 3), there may be scan lines for which the footprints of both C₁    and C₂ will overlap the edge of wafer 22, so that neither sensor    will give a valid reading, as noted above.

When look-ahead control is used, as given by equation (1) above,footprint 52 of the look-ahead sensor (C₂ in the example of FIG. 3,assuming upward scanning) moves onto wafer 22 at the beginning of thescan line before focal area 50 moves onto the wafer. Therefore, thelook-ahead sensor starts to provide valid readings of the sensor height(d₂ in the present example) before the actual optical image acquisitionbegins. Controller 38 places these readings of h₂ in afirst-in-first-out (FIFO) buffer, according to the locations of thepoints at which the readings were taken. As soon as the first validreading of h₂ is taken at the beginning of the scan line, controller 38may drive stage 36 to adjust the Z-position of stage 36 accordingly. Asa result, when focal area 50 moves onto the wafer a short time later,the focus will already be approximately correct. Once footprint 52 of C₂has advanced by a distance D onto the wafer along the scan line, theFIFO buffer will be filled with entries, and the method of autofocusadjustment may proceed in accordance with equation (1), as describedabove. At the end of the scan line, look-ahead focus adjustmentcontinues until there are no more valid height readings in the FIFObuffer, at which point the Z-position is locked until the next scanline.

When balanced control is used (according to equation (2) or (3), forexample), the treatment of the beginning and end of scan lines isdifferent. For the sake of simplicity, this treatment is described withreference to the arithmetic averaging approach (equation (2)), althoughit may be extended in a straightforward manner to higher-order heightestimation procedures. As focal area 50 approaches the end of a givenscan line, the last valid height reading from the leading sensor (C₂ inthe example of FIG. 3, assuming upward scanning) is used to compute aheight offset h_(ofs)=(h₂ ⁰−h₁ ⁰)/2, wherein h₂ ⁰ is the last validreading from the leading sensor and h₁ ⁰ is the reading taken from C₁ atthe time of reading h₂ ⁰. As long as footprint 52 of C₂ is entirely orpartly off wafer 22, the height parameter used by controller 38 is givenby h(y)=h₁(y)+h_(ofs), instead of the average height reading given byequation (2). This estimated input is used both at the end of one scanline and at the beginning of the subsequent scan line, before the h₂(y)height reading becomes valid. When neither C₁ nor C₂ gives a validreading, the Z-position of stage 36 is locked.

For scan lines at the beginning of a wafer scan, a pre-acquired estimateof the height reading of the look-ahead sensor (for look-ahead autofocusoperation) or of both sensors (for balanced mode) may be used to set theZ-position of stage 36 when there is no valid height sensor reading forthe scan line. To acquire these height estimates, stage 34 translateswafer 22 toward the center of the wafer so that detector assembly 27 andsensors 40 are located on a scan line that is closer to the center ofthe wafer. At this X-position, footprint 52 of at least one of sensors40 is entirely on wafer 22. (For look-ahead control, it is sufficientthat the footprint of the look-ahead sensor be on the wafer. Forbalanced control, it is desirable that the footprints of both sensors beon the wafer.) Controller 38 acquires and stores height readings fromthe sensors at the locations along this scan line. Stage 34 thentranslates the wafer to the scan slice starting position, so that thedetector assembly can begin to scan from the starting edge of the wafer.At each position on the initial scan line or lines, as long as C₁ and C₂do not give valid readings, controller 38 adjusts the height of stage 36using the height readings measured at the nearest position on thepre-acquired scan line. Similarly, at the end of the wafer scan,controller 38 sets the height of stage 36 using the height readingstaken at the nearest points along the preceding scan lines.

FIG. 4 is a schematic top view of a sample under inspection, showing analternative arrangement 60 of height sensors 40, in accordance withanother embodiment of the present invention. In this embodiment, fourheight sensors, labeled C₁ through C₄ are arranged in pairs on oppositesides of a detector assembly (not shown in this figure), so that theirfootprints 52 surround focal area 50. The height sensor readings may beaveraged to give a more accurate estimate of the height of the objectiveoptics than in the dual-sensor embodiment shown above. Alternatively oradditionally, the sensors may be used in a look-ahead mode to supportscans along the X-axis, as well as the Y-axis. Other arrangementscomprising more than two pairs of height sensors may also be used forsuch purposes and are considered to be within the scope of the presentinvention.

In an alternative embodiment, not shown in the figures, a single heightsensor is positioned alongside the detector assembly, and makes heightmeasurements in the look-ahead mode described above. In this embodiment,translation stage 34 is typically configured to scan all the lines ofthe raster pattern in the same direction, so that the height sensor isahead of the detector assembly on all the scan lines. Alternatively, thedetector assembly and height sensor may be rotated about the opticalaxis of the detector assembly so that the height sensor remains ahead ofthe detector assembly on all scan lines regardless of scanningdirection.

As noted earlier, although the embodiments described above are directedto optical inspection of semiconductor wafers in a certain opticalconfiguration, the principles of the present invention may similarly beapplied to other optical inspection tasks and configurations and todifferent sorts of samples under inspection. It will thus be appreciatedthat the embodiments described above are cited by way of example, andthat the present invention is not limited to what has been particularlyshown and described hereinabove. Rather, the scope of the presentinvention includes both combinations and subcombinations of the variousfeatures described hereinabove, as well as variations and modificationsthereof which would occur to persons skilled in the art upon reading theforegoing description and which are not disclosed in the prior art.

1. An apparatus, comprising: a detector configured to receive radiationfrom a focal area on a sample; a sensor, positioned in a known locationrelative to the detector along a translation path of the detector withrespect to the sample; and a controller, adapted to determine anestimated height of the detector from the sample according to a heightmeasured by the sensor from the sample at a site along the translationpath but outside of the focal area.
 2. The apparatus according to claim1, further comprising means operative to adjust a focus of the detectorresponsively to the estimated height.
 3. The apparatus according toclaim 2, further comprising a second sensor positioned in a second knownlocation relative to the detector and configured to measure a secondestimated height relative to the sample at a second site outside of thefocal area.
 4. The apparatus according to claim 3, wherein thecontroller is operative to determine the estimated height responsivelyto the estimated height and the second estimated height.
 5. A method,comprising determining an estimated height of a detector from a surfaceof a sample under inspection, the detector being configured to receiveradiation from a focal area on said surface of said sample, saidestimated height computed according to a measured distance between asensor and said surface of said sample at a location outside of saidfocal area and along a translation path of said detector with respect tosaid sample.
 6. The method according to claim 5, further comprisingadjusting a focus of the detector responsively to the estimated height.7. The method according to claim 6, further comprising tilting thesensor without blocking a collection angle of the detector with respectto the focal area.
 8. The method according to claim 6, wherein saidestimated height is further determined according to a second measureddistance between a second sensor and said surface of said sample at asecond locations outside of said focal area.